<?php
// 链接
$servername="localhost";
$username="root";
$password="root";
$dbname="liuyanban";

$conn=new mysqli("localhost","root","root","liuyanban");
if($conn->connect_error){
    die("连接失败:" .$conn->connect_error);
}

$name=$_GET["name"];
$text=$_GET["text"];
$time=date("Y-m-d H:i:s",time());


// 插入语句
$sql="INSERT INTO `liuyan` (`id`,`name`,`text`,`tiem`) VALUES (NULL, '$name','$text','$time')";
// 执行语句
$conn->query($sql);

// if ($conn->query($sql) === TRUE) {
//     echo "数据库创建成功";
// } else {
//     echo "Error creating database: " . $conn->error;
// }

// 断开数据库连接
$conn->close();
header("Location:list.php");
?>
